Release 10.1A: OpenEdge Development:
Progress Dynamics Basic Development
Defining a custom super procedure
If you define dynamic, logical objects in your Progress Dynamics application, they exist only as records in the Repository database. Therefore, you have no source procedure where you can write custom code that is needed by the dynamic object. Progress Dynamics handles this situation by letting you define a custom procedure containing code needed by a dynamic object. This file is referred to as a custom super procedure because at run time it runs as a persistent procedure and is made a super procedure of the object it supports. In this way, any
RUNstatement done in the dynamic object will find the supporting code in the super procedure and execute it there. Because this toolbar example uses custom code to support some of its actions, one specific example of the technique is provided here.
![]()
To create the procedure where you can write the
EditActioncode:
- Create a new structured procedure in the AppBuilder. So that the procedure is registered in the Repository, specify an appropriate Product Module to be associated with it, as shown:
![]()
- In the wizard for the Structured Procedure, provide the name, description, and purpose for the procedure, which will be added to the comments section at the beginning of the procedure as internal documentation.
- When you complete the wizard, choose the Edit icon in the AppBuilder. This displays the AppBuilder’s Section Editor.
- Select Procedures from the Section drop-down list.
- Choose the New button to create a new procedure, providing EditAction as the name.
The following code is for the
EditActionprocedure, which uses its input parameter (which you specified when you defined the actions for the Cut, Copy, and Paste items in the Menu and Toolbar Designer) to handle all three operations:
- Enter this code and save your procedure where it will be found in your
Propath.- Open your dynamic window (custfoldwin or whatever window you are using) using the Open Object dialog box again.
Note: You are associating the procedure with the window, not directly with the toolbar. This is because toolbar item actions that run internal procedures look for them in the container, not in the toolbar object itself, if there is no specific action link to another object.- Enter the name of your procedure (including a relative pathname if needed) in the field labeled Custom ADD-SUPER-PROC.
- Save the dynamic window and relaunch it (or the browse window that precedes it) via the Dynamic Launcher. Now you will see the Cut, Copy, and Paste items enabled (both as menu items and as toolbar buttons), and you can use them to edit, for example, the Comments field for the
Customer.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |